<?php

namespace Admin\Controller;

use Think\Model;

/**
 * Description of SpActivityController
 *
 * @author Myron
 */
class SpActivityController extends AdminController {
     /**
     * 展示活动商品
     * @author 曹梦龙 <138888611@qq.com>
     */ 
    public function index(){
        $name = I('name');
        $pCategoryId=I('pid');
        if($pCategoryId>0){
            $map['pCategoryId']= $pCategoryId;
        }
        $map['name'] = array('like', '%' . (string) $name . '%');
        
        $list = $this->lists('sp_product', $map);
        int_to_string($list);
        $this->assign('_list', $list);
        $pcategorylist = M('sp_pcategory')->where(array('status' => 1))->order('type')->select();
        $this->assign('pcategorylist', $pcategorylist);
        $this->assign('pCategoryId', $pCategoryId);
        $this->meta_title = '展示商品列表';
        $this->display();
    }
}
